import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)


export const createRouter = () => {
  const router = new VueRouter({
    mode: "history", //兼容同构应用
    routes: [
      {
        path: "/",
        name: "home",
        component: () => import('@/pages/Home.vue')
      },
      {
        path: "/about",
        name: "about",
        component: () => import('@/pages/About.vue')
      },
      {
        path: "*",
        name: "404",
        component: () => import('@/pages/404.vue')
      }
    ]
  })

  return router
}